package br.ufc.engsoft.smm.banco;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class PerguntaWSDL implements KvmSerializable {
	public String pergunta, resposta1,resposta2,resposta3,resposta4;
	public int nivel, correto;
	public PerguntaWSDL(){}
	public PerguntaWSDL(String P, String R1, String R2, String R3, String R4, int n, int c){
		pergunta = P;
		resposta1 = R1;
		resposta2 = R2;
		resposta3 = R3;
		resposta4 = R4;
		nivel = n;
		correto = c;
	}
	public Object getProperty(int arg0) {
		switch(arg0){
		case 0: return pergunta;
		case 1: return resposta1;
		case 2: return resposta2;
		case 3: return resposta3;
		case 4: return resposta4;
		case 5: return correto;
		case 6: return nivel;
		}
		// TODO Auto-generated method stub
		return null;
	}
	public int getPropertyCount() {
		// TODO Auto-generated method stub
		return 7;
	}
	public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo info) {
		// TODO Auto-generated method stub
		switch(arg0){
		case 0:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "pergunta";
			break;
		case 1: 
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "resposta1";
			break;
		case 2: 
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "resposta2";
			break;
		case 3: 
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "resposta3";
			break;
		case 4: 
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "resposta4";
			break;
		case 5: 
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "correto";
			break;
		case 6: 
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "nivel";
			break;
		}
		
	}
	public void setProperty(int arg0, Object arg1) {
		switch(arg0){
		case 0: pergunta = arg1.toString(); break;
		case 1: resposta1 = arg1.toString(); break;
		case 2: resposta2 = arg1.toString(); break;
		case 3: resposta3 = arg1.toString(); break;
		case 4: resposta4 = arg1.toString(); break;
		case 5: correto = Integer.parseInt(arg1.toString()); break;
		case 6: nivel = Integer.parseInt(arg1.toString()); break;
		}
		// TODO Auto-generated method stub
		
	}
}
